#include "SFC_Inc.hpp"
#include "SFC_Event.h"

std::string SFC_Event::ToString()
{
	std::stringstream buf;
	switch(this->Type)
	{
	case EventType::Mouse:
		buf << "EventType.Mouse";
		switch(this->Mouse.Type)
		{
		case MouseEventType::Down: buf << ".Down";    break;
		case MouseEventType::Move: buf << ".Move";    break;
		case MouseEventType::Up:   buf << ".Up";      break;
		default:                   buf << ".Unknow";  break;
		}
		buf << " [x=" << this->Forcus.x << ", y=" << this->Forcus.y << "]";
		break;
	case EventType::Window:
		buf << "EventType.Window";
		switch(this->Window.Type)
		{
		case WindowEventType::Closing:
			buf << ".Closing";
			break;
		case WindowEventType::Paint:
			buf << ".Paint";
			break;
		default:
			buf << "Unknow window event type.";
		}
		break;
	case EventType::Power:
		buf << "EventType.Power";
		switch(this->Power.Type)
		{
		case PowerEventType::Shutdown:
			buf << ".Shutdown";
			break;
		default:
			buf << "Unknow power event type.";
		}
		break;
	default:
		buf << "Unknow event [Type=" << (int)this->Type << "]";
	}
	return buf.str();
}

SFC_Event::operator std::string ()
{
	return ToString();
}